home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL-ftn / fglmap2.z / fglmap2
Encoding:
Text File  |  2002-10-03  |  22.7 KB  |  361 lines

  1.  
  2.  
  3.  
  4. ffffggggllllMMMMaaaapppp2222((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp2222((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ffffggggllllMMMMaaaapppp2222dddd,,,, ffffggggllllMMMMaaaapppp2222ffff - define a two-dimensional evaluator
  10.  
  11.  
  12. FFFFOOOORRRRTTTTRRRRAAAANNNN SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      SUBROUTINE ffffggggllllMMMMaaaapppp2222dddd( INTEGER*4 _t_a_r_g_e_t,
  14.                           REAL*4 _u_1,
  15.                           REAL*4 _u_2,
  16.                           INTEGER*4 _u_s_t_r_i_d_e,
  17.                           INTEGER*4 _u_o_r_d_e_r,
  18.                           REAL*4 _v_1,
  19.                           REAL*4 _v_2,
  20.                           INTEGER*4 _v_s_t_r_i_d_e,
  21.                           INTEGER*4 _v_o_r_d_e_r,
  22.                           CHARACTER*8 _p_o_i_n_t_s )
  23.      SUBROUTINE ffffggggllllMMMMaaaapppp2222ffff( INTEGER*4 _t_a_r_g_e_t,
  24.                           REAL*4 _u_1,
  25.                           REAL*4 _u_2,
  26.                           INTEGER*4 _u_s_t_r_i_d_e,
  27.                           INTEGER*4 _u_o_r_d_e_r,
  28.                           REAL*4 _v_1,
  29.                           REAL*4 _v_2,
  30.                           INTEGER*4 _v_s_t_r_i_d_e,
  31.                           INTEGER*4 _v_o_r_d_e_r,
  32.                           CHARACTER*8 _p_o_i_n_t_s )
  33.  
  34.  
  35. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  36.      _t_a_r_g_e_t   Specifies the kind of values that are generated by the
  37.               evaluator.  Symbolic constants GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333,
  38.               GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444, GGGGLLLL____MMMMAAAAPPPP2222____IIIINNNNDDDDEEEEXXXX, GGGGLLLL____MMMMAAAAPPPP2222____CCCCOOOOLLLLOOOORRRR____4444,
  39.               GGGGLLLL____MMMMAAAAPPPP2222____NNNNOOOORRRRMMMMAAAALLLL, GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111,
  40.               GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222, GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333, and
  41.               GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444 are accepted.
  42.  
  43.      _u_1, _u_2   Specify a linear mapping of u, as presented to ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd2222, to
  44.               u^, one of the two variables that are evaluated by the equations
  45.               specified by this command. Initially, _u_1 is 0 and _u_2 is 1.
  46.  
  47.      _u_s_t_r_i_d_e  Specifies the number of floats or doubles between the beginning
  48.               of control point R   and the beginning of control point R      ,
  49.                                 ij                                     (i+1)j
  50.               where i and j are the u and v control point indices,
  51.               respectively.  This allows control points to be embedded in
  52.               arbitrary data structures.  The only constraint is that the
  53.               values for a particular control point must occupy contiguous
  54.               memory locations. The initial value of _u_s_t_r_i_d_e is 0.
  55.  
  56.      _u_o_r_d_e_r   Specifies the dimension of the control point array in the u
  57.               axis.  Must be positive. The initial value is 1.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                                                         PPPPaaaaggggeeee 1111
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71. ffffggggllllMMMMaaaapppp2222((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp2222((((3333GGGG))))
  72.  
  73.  
  74.  
  75.      _v_1, _v_2   Specify a linear mapping of v, as presented to ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd2222, to
  76.               v^, one of the two variables that are evaluated by the equations
  77.               specified by this command. Initially, _v_1 is 0 and _v_2 is 1.
  78.  
  79.      _v_s_t_r_i_d_e  Specifies the number of floats or doubles between the beginning
  80.               of control point R   and the beginning of control point R      ,
  81.                                 ij                                     i(j+1)
  82.               where i and j are the u and v control point indices,
  83.               respectively.  This allows control points to be embedded in
  84.               arbitrary data structures.  The only constraint is that the
  85.               values for a particular control point must occupy contiguous
  86.               memory locations. The initial value of _v_s_t_r_i_d_e is 0.
  87.  
  88.      _v_o_r_d_e_r   Specifies the dimension of the control point array in the v
  89.               axis.  Must be positive. The initial value is 1.
  90.  
  91.      _p_o_i_n_t_s   Specifies a pointer to the array of control points.
  92.  
  93. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  94.      Evaluators provide a way to use polynomial or rational polynomial mapping
  95.      to produce vertices, normals, texture coordinates, and colors.  The
  96.      values produced by an evaluator are sent on to further stages of GL
  97.      processing just as if they had been presented using ffffggggllllVVVVeeeerrrrtttteeeexxxx, ffffggggllllNNNNoooorrrrmmmmaaaallll,
  98.      ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, and ffffggggllllCCCCoooolllloooorrrr commands, except that the generated values do
  99.      not update the current normal, texture coordinates, or color.
  100.  
  101.      All polynomial or rational polynomial splines of any degree (up to the
  102.      maximum degree supported by the GL implementation) can be described using
  103.      evaluators.  These include almost all surfaces used in computer graphics,
  104.      including B-spline surfaces, NURBS surfaces, Bezier surfaces, and so on.
  105.  
  106.      Evaluators define surfaces based on bivariate Bernstein polynomials.
  107.      Define p(u^,v^) as
  108.  
  109.                                               m     n      m
  110.                                       n           B (u^) B (v^) R
  111.                       p(u^,v^)  =               R    i     j     ij
  112.                                       R
  113.                                          j = 0
  114.                                  i = 0
  115.  
  116.  
  117.  
  118.                                      n
  119.      where R   is a control point, B (u^) is the ith Bernstein polynomial of
  120.             ij                      i
  121.      degree
  122.      n (_u_o_r_d_e_r = n + 1)
  123.  
  124.                                        (   )
  125.                                n          n   i     n-i
  126.                              B (u^)  =  |   | u^ (1-u^)
  127.                               i
  128.                                        (i )
  129.  
  130.  
  131.            m
  132.      and B (v^) is the jth Bernstein polynomial of degree m (_v_o_r_d_e_r = m + 1)
  133.           j
  134.  
  135.                                        (   )
  136.                                m          m   j     m-j
  137.                              B (v^)  =  |   | v^ (1-v^)
  138.                               j
  139.                                        (j )
  140.  
  141.  
  142.      Recall that
  143.                                           (   )
  144.                                 0           n
  145.                                0  _= 1 and |   |   _=  1
  146.  
  147.                                           (0 )
  148.  
  149.  
  150.  
  151.  
  152.                                                                         PPPPaaaaggggeeee 2222
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. ffffggggllllMMMMaaaapppp2222((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp2222((((3333GGGG))))
  160.  
  161.  
  162.  
  163.      ffffggggllllMMMMaaaapppp2222 is used to define the basis and to specify what kind of values
  164.      are produced.  Once defined, a map can be enabled and disabled by calling
  165.      ffffggggllllEEEEnnnnaaaabbbblllleeee and ffffggggllllDDDDiiiissssaaaabbbblllleeee with the map name, one of the nine predefined
  166.      values for _t_a_r_g_e_t, described below.  When ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd2222 presents values u
  167.      and v, the bivariate Bernstein polynomials are evaluated using u^ and v^,
  168.      where
  169.  
  170.                                                 u - u1_______
  171.                                    u^  =
  172.                                          u2 - u1
  173.  
  174.                                                 v - v1_______
  175.                                    v^  =
  176.                                          v2 - v1
  177.  
  178.  
  179.      _t_a_r_g_e_t is a symbolic constant that indicates what kind of control points
  180.      are provided in _p_o_i_n_t_s, and what output is generated when the map is
  181.      evaluated.  It can assume one of nine predefined values:
  182.  
  183.      GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333         Each control point is three floating-point
  184.                               values representing x, y, and z.  Internal
  185.                               ffffggggllllVVVVeeeerrrrtttteeeexxxx3333 commands are generated when the map
  186.                               is evaluated.
  187.  
  188.      GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444         Each control point is four floating-point values
  189.                               representing x, y, z, and w.  Internal
  190.                               ffffggggllllVVVVeeeerrrrtttteeeexxxx4444 commands are generated when the map
  191.                               is evaluated.
  192.  
  193.      GGGGLLLL____MMMMAAAAPPPP2222____IIIINNNNDDDDEEEEXXXX            Each control point is a single floating-point
  194.                               value representing a color index.  Internal
  195.                               ffffggggllllIIIInnnnddddeeeexxxx commands are generated when the map is
  196.                               evaluated but the current index is not updated
  197.                               with the value of these ffffggggllllIIIInnnnddddeeeexxxx commands.
  198.  
  199.      GGGGLLLL____MMMMAAAAPPPP2222____CCCCOOOOLLLLOOOORRRR____4444          Each control point is four floating-point values
  200.                               representing red, green, blue, and alpha.
  201.                               Internal ffffggggllllCCCCoooolllloooorrrr4444 commands are generated when
  202.                               the map is evaluated but the current color is
  203.                               not updated with the value of these ffffggggllllCCCCoooolllloooorrrr4444
  204.                               commands.
  205.  
  206.      GGGGLLLL____MMMMAAAAPPPP2222____NNNNOOOORRRRMMMMAAAALLLL           Each control point is three floating-point
  207.                               values representing the x, y, and z components
  208.                               of a normal vector.  Internal ffffggggllllNNNNoooorrrrmmmmaaaallll commands
  209.                               are generated when the map is evaluated but the
  210.                               current normal is not updated with the value of
  211.                               these ffffggggllllNNNNoooorrrrmmmmaaaallll commands.
  212.  
  213.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111  Each control point is a single floating-point
  214.                               value representing the s texture coordinate.
  215.                               Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd1111 commands are generated
  216.                               when the map is evaluated but the current
  217.                               texture coordinates are not updated with the
  218.                               value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  219.  
  220.  
  221.  
  222.  
  223.                                                                         PPPPaaaaggggeeee 3333
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. ffffggggllllMMMMaaaapppp2222((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp2222((((3333GGGG))))
  231.  
  232.  
  233.  
  234.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222  Each control point is two floating-point values
  235.                               representing the s and t texture coordinates.
  236.                               Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd2222 commands are generated
  237.                               when the map is evaluated but the current
  238.                               texture coordinates are not updated with the
  239.                               value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  240.  
  241.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333  Each control point is three floating-point
  242.                               values representing the s, t, and r texture
  243.                               coordinates.  Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd3333 commands are
  244.                               generated when the map is evaluated but the
  245.                               current texture coordinates are not updated with
  246.                               the value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  247.  
  248.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444  Each control point is four floating-point values
  249.                               representing the s, t, r, and q texture
  250.                               coordinates.  Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd4444 commands are
  251.                               generated when the map is evaluated but the
  252.                               current texture coordinates are not updated with
  253.                               the value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  254.  
  255.      _u_s_t_r_i_d_e, _u_o_r_d_e_r, _v_s_t_r_i_d_e, _v_o_r_d_e_r, and _p_o_i_n_t_s define the array addressing
  256.      for accessing the control points.  _p_o_i_n_t_s is the location of the first
  257.      control point, which occupies one, two, three, or four contiguous memory
  258.      locations, depending on which map is being defined.  There are
  259.      uorder x vorder control points in the array.  _u_s_t_r_i_d_e specifies how many
  260.      float or double locations are skipped to advance the internal memory
  261.      pointer from control point R   to control point R      .  _v_s_t_r_i_d_e
  262.                                  ij                   (i+1)j
  263.      specifies how many float or double locations are skipped to advance the
  264.      internal memory pointer from control point R   to control point R      .
  265.                                                  ij                   i(j+1)
  266.  
  267. NNNNOOOOTTTTEEEESSSS
  268.      As is the case with all GL commands that accept pointers to data, it is
  269.      as if the contents of _p_o_i_n_t_s were copied by ffffggggllllMMMMaaaapppp2222 before ffffggggllllMMMMaaaapppp2222
  270.      returns.  Changes to the contents of _p_o_i_n_t_s have no effect after ffffggggllllMMMMaaaapppp2222
  271.      is called.
  272.  
  273.      Initially, GGGGLLLL____AAAAUUUUTTTTOOOO____NNNNOOOORRRRMMMMAAAALLLL is enabled. If GGGGLLLL____AAAAUUUUTTTTOOOO____NNNNOOOORRRRMMMMAAAALLLL is enabled,
  274.      normal vectors are generated when either GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333 or
  275.      GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444 is used to generate vertices.
  276.  
  277. EEEERRRRRRRROOOORRRRSSSS
  278.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _t_a_r_g_e_t is not an accepted value.
  279.  
  280.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _u_1 is equal to _u_2, or if _v_1 is equal to
  281.      _v_2.
  282.  
  283.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if either _u_s_t_r_i_d_e or _v_s_t_r_i_d_e is less than
  284.      the number of values in a control point.
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.                                                                         PPPPaaaaggggeeee 4444
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298. ffffggggllllMMMMaaaapppp2222((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp2222((((3333GGGG))))
  299.  
  300.  
  301.  
  302.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if either _u_o_r_d_e_r or _v_o_r_d_e_r is less than 1
  303.      or greater than the return value of GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR.
  304.  
  305.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ffffggggllllMMMMaaaapppp2222 is executed between the
  306.      execution of ffffggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ffffggggllllEEEEnnnndddd.
  307.  
  308. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  309.      ffffggggllllGGGGeeeettttMMMMaaaapppp
  310.      ffffggggllllGGGGeeeetttt with argument GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR
  311.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333
  312.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444
  313.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____IIIINNNNDDDDEEEEXXXX
  314.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____CCCCOOOOLLLLOOOORRRR____4444
  315.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____NNNNOOOORRRRMMMMAAAALLLL
  316.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111
  317.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222
  318.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333
  319.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444
  320.  
  321.  
  322. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  323.      ffffggggllllBBBBeeeeggggiiiinnnn, ffffggggllllCCCCoooolllloooorrrr, ffffggggllllEEEEnnnnaaaabbbblllleeee, ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd, ffffggggllllEEEEvvvvaaaallllMMMMeeeesssshhhh, ffffggggllllEEEEvvvvaaaallllPPPPooooiiiinnnntttt,
  324.      ffffggggllllMMMMaaaapppp1111, ffffggggllllMMMMaaaappppGGGGrrrriiiidddd, ffffggggllllNNNNoooorrrrmmmmaaaallll, ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, ffffggggllllVVVVeeeerrrrtttteeeexxxx
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.                                                                         PPPPaaaaggggeeee 5555
  358.  
  359.  
  360.  
  361.